import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '所属预算 Id',
    align:"center",
    dataIndex: 'budgetId'
   },
   {
    title: '预算批次',
    align:"center",
    dataIndex: 'budgetNo_dictText'
   },
   {
    title: '征拆户',
    align:"center",
    dataIndex: 'peopleId_dictText'
   },
   {
    title: '补偿款类型',
    align:"center",
    dataIndex: 'chargeTypeId_dictText'
   },
   {
    title: '数量',
    align:"center",
    dataIndex: 'budgetQuantity'
   },
   {
    title: '单价',
    align:"center",
    dataIndex: 'budgetPrice'
   },
   {
    title: '折扣',
    align:"center",
    dataIndex: 'budgetDisCount'
   },
   {
    title: '预算金额',
    align:"center",
    dataIndex: 'budgetCharge'
   },
   {
    title: '最终数量',
    align:"center",
    dataIndex: 'realQuantity'
   },
   {
    title: '最终单价',
    align:"center",
    dataIndex: 'realPrice'
   },
   {
    title: '最终折扣',
    align:"center",
    dataIndex: 'realDisCount'
   },
   {
    title: '最终预算金额',
    align:"center",
    dataIndex: 'realCharge'
   },
   {
    title: '说明',
    align:"center",
    dataIndex: 'realNotes'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '所属预算 Id',
    field: 'budgetId',
    component: 'Input',
  },
  {
    label: '预算批次',
    field: 'budgetNo',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"project_budget,budget_num,budget_num"
     },
  },
  {
    label: '征拆户',
    field: 'peopleId',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"people,name,name"
     },
  },
  {
    label: '补偿款类型',
    field: 'chargeTypeId',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"charge_type_id"
     },
  },
  {
    label: '数量',
    field: 'budgetQuantity',
    component: 'InputNumber',
  },
  {
    label: '单价',
    field: 'budgetPrice',
    component: 'InputNumber',
  },
  {
    label: '折扣',
    field: 'budgetDisCount',
    component: 'InputNumber',
  },
  {
    label: '预算金额',
    field: 'budgetCharge',
    component: 'InputNumber',
  },
  {
    label: '最终数量',
    field: 'realQuantity',
    component: 'InputNumber',
  },
  {
    label: '最终单价',
    field: 'realPrice',
    component: 'InputNumber',
  },
  {
    label: '最终折扣',
    field: 'realDisCount',
    component: 'InputNumber',
  },
  {
    label: '最终预算金额',
    field: 'realCharge',
    component: 'InputNumber',
  },
  {
    label: '说明',
    field: 'realNotes',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];



/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}